package com.cloudfun.campusshare.common.constant;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/6/2 11:03
 * @description : 提现状态
 */
public enum CashAdvanceStatus {
    IN_PROGRESSING(1,"提现中","审核中"),
    SUCCESS(2,"提现成功","已通过"),
    FAIL(3,"提现失败","已驳回");

    private int code;
    private String userMessage;
    private String merchantMessage;

    CashAdvanceStatus(int code, String userMessage, String merchantMessage) {
        this.code = code;
        this.userMessage = userMessage;
        this.merchantMessage = merchantMessage;
    }

    public int getCode() {
        return code;
    }

    public String getUserMessage() {
        return userMessage;
    }

    public String getMerchantMessage() {
        return merchantMessage;
    }


    public static CashAdvanceStatus getByCode(Integer code){
        if(code == null){
            return null;
        }

        CashAdvanceStatus[] values = CashAdvanceStatus.values();
        for (CashAdvanceStatus value : values) {
            if(value.code == code.intValue()){
                return value;
            }
        }
        return null;
    }
}
